package com.miniboy.imageloader_sample;

import android.app.Application;

import com.miniboy.imageloader.ImageLoader;
import com.miniboy.imageloader.config.ImageOptions;

/**
 * 作者 ${郭鹏飞}.<br/>
 */
public class FLYApplication extends Application {

    private static FLYApplication instance = null;
    private ImageLoader mImageLoader;

    @Override
    public void onCreate() {
        super.onCreate();
        if (instance == null) {
            instance = this;
        }
        ImageOptions imageOptions = new ImageOptions.ImageOptionsBuilder().
                type(ImageOptions.TYPE_ALL_CACHE).
                build();
        mImageLoader = ImageLoader.getInstance(this).init(imageOptions);
    }

    public ImageLoader getImageLoader() {
        return mImageLoader;
    }

    public static FLYApplication getInstance() {
        return instance;
    }
}
